import os
import signal
from subprocess import Popen, PIPE

def kill():
    os.kill(os.getpid(), signal.SIGINT)

def proj_root():
    return os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

def svn_up():
    os.chdir(proj_root())
    proc = Popen('svn up', shell = True, stdout = PIPE, stderr = PIPE)
    resp = proc.communicate()
    out, err = resp[0].strip().split('\n'), resp[1].strip().split('\n')
    return [o for o in out if len(o) > 0], [e for e in err if len(e) > 0]

